FROM node:14.11.0-alpine as Builder
WORKDIR /program

COPY package.json package.json
COPY tsconfig.json tsconfig.json
COPY src src
COPY babel.config.json babel.config.json
COPY webpack.config.js webpack.config.js
RUN npm install --registry https://registry.npm.taobao.org
RUN npm run compile

FROM node:14.11.0-alpine
WORKDIR /program
COPY --from=Builder /program/bin bin
COPY package.json package.json
RUN npm install --registry https://registry.npm.taobao.org
EXPOSE 10000
EXPOSE 10001

CMD [ "node", "bin/Program.js" ]
